#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;

using llt = long long;
using vi = vector<int>;
using vll =vector<llt>;
using pii = pair<int, int>;
using vpii = vector<pii>;

int const INF = 3;

template<typename T>
istream & operator >> (istream & is, vector<T> & v){
	for(auto & i : v) is >> i;
	return is;
}

template<typename T>
void input(vector<T> &v, int n){
	v.assign(n + 1, {});
	for(int i=1;i<=n;++i) cin >> v[i];
	return;
}

string S;
bool proc(){
	if('R' == S[0]){
		if('M' == S[1] or 'M' == S[2]) return true;
		return false;
	}
	if('R' == S[1]){
		if(S[2] == 'M') return true;
		return false;
	} 
	return false;
}
void work(){
	cin >> S;
	cout << (proc() ? "Yes\n" : "No\n");
    return;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int nofkase = 1;
    // cin >> nofkase;
    while(nofkase--) work();
    return 0;
}